package com.eleventwelve.iris.web.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;
import com.eleventwelve.iris.entity.MedicalProcedure;


public class MedicalProcedureValidator implements Validator {

	@Override
	public boolean supports(Class<?> arg0) {
		return MedicalProcedure.class.isAssignableFrom(arg0);
		
	}

	@Override
	public void validate(Object obj, Errors err) {
		ValidationUtils.rejectIfEmptyOrWhitespace(err, "name", "error.required-field", new Object[] { "Procedure Name" });
		
	}

}
